Skip to content

fix(e2e-harness): exit tui-snapshots with the host's exit code - #1341

Merged
gewenyu99 merged 2 commits into
mainfrom
posthog/fix-1333-snapshot-exit-code
Oct 7, 2026
Merged

gewenyu99 merged 2 commits into
mainfrom
posthog/fix-1333-snapshot-exit-code

Conversation

@gewenyu99

Copy link
Copy Markdown
Collaborator

Problem

tui-snapshots always exits 0. TuiCapture.exited resolves without the host's exit code, so a host crash or an aborted run still passes the sweep. The workbench pass condition includes run.status === 0, so it never sees a host failure.

Part of #1333 (the exit-code half of item 5).

Changes

  • TuiCapture.exited. Resolves with the exit code, or 128 + signal.
  • tui-snapshots. Exits with that code and prints it on the done line.

Nothing flows here. tui-capture.ts passes node-pty's exit code through, and the driver uses it.

This covers host crashes and wizardAbort exits. A run that completes with a missing report still exits 0. That check waits on picking one report channel in #1332.

Test plan

tui-capture.test.ts spawns a child in a PTY that exits 0, exits 3, or kills itself with SIGTERM, and expects 0, 3 and 143. It failed on main and passes with the fix.

pnpm typecheck, pnpm lint (0 errors) and pnpm test (200 files, 3351 tests) pass.

LLM context

Written by Claude Code while triaging the real-TUI sweep issues.

Created with PostHog Desktop

TuiCapture.exited resolved without the child's exit code, and
tui-snapshots always exited 0, so a host crash or an aborted run still
passed the sweep. `exited` now resolves with the exit code, or 128 +
signal when a signal ended the host, and tui-snapshots exits with it.

Part of #1333

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci feature-flags
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci feature-flags/django
  • /wizard-ci feature-flags/next-js
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a Context Mill branch:

  • /wizard-ci all context-mill:my-branch

Add context-mill:<branch> to any command above to pin the Context Mill branch. It defaults to main.

Results will be posted here when complete.

@gewenyu99
gewenyu99 marked this pull request as ready for review September 24, 2026 22:35
@gewenyu99
gewenyu99 requested a review from a team as a code owner September 24, 2026 22:35

@johncwaters johncwaters left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Automated review. Not written by a human.

Reviewed: TuiCapture.exited now resolves with the host's exit code (128 + signal on signal death), and tui-snapshots exits with it. The only consumer is updated, the host's success path exits 0, and the new test covers exit 0, exit 3 and SIGTERM. No issues found.

@gewenyu99
gewenyu99 enabled auto-merge (squash) October 7, 2026 14:01
@gewenyu99
gewenyu99 merged commit f0d301e into main Oct 7, 2026
18 checks passed
@gewenyu99
gewenyu99 deleted the posthog/fix-1333-snapshot-exit-code branch October 7, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants